﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace VSAddIn
{
    class VAUtil
    {
        public static string ExecuteExternalTool(string fileName, string arguments)
        {
            // Set process information
            Process p = new Process();
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.FileName = fileName;
            p.StartInfo.Arguments = arguments;

            // Execute and get the output
            p.Start();
            p.WaitForExit();
            string output = p.StandardOutput.ReadToEnd();

            return output;
        }
    }
}
